package cn.cloudreal.cbms.contract.service.impl;

import java.util.List;

import cn.cloudreal.cbms.common.util.PageBean;
import cn.cloudreal.cbms.contract.dao.ContractListDao;
import cn.cloudreal.cbms.contract.service.ContractListService;
import cn.cloudreal.cbms.vo.Contract;
import cn.cloudreal.cbms.vo.MediaPrice;

public class ContractListServiceImpl implements ContractListService{

	ContractListDao contractListDao;
	
	
	public void setContractListDao(ContractListDao contractListDao) {
		this.contractListDao = contractListDao;
	}

	/**
     * 分页查询媒体列表
     */
	public List<Contract> findContractList(PageBean page, Contract contract) {
	
		return contractListDao.findContractList(page, contract);
	}
	/**
     * 插入合同
     */
	public void addContract(Contract contract) {
		contractListDao.addContract(contract);
	}
	/**
     * 删除合同
     */
	public void deleteContract(String contractId) {
		contractListDao.deleteContract(contractId);
	}
	/**
     * 查看详细合同
     */
	public Contract detailContract(String contractId) {
		return contractListDao.detailContract(contractId);
	}
	

	 /**
     * 按合同年份,合同编号等查询合同
     */
    public List<Contract> findContractByYears(Contract contract)
    {
        
        return contractListDao.findContractByYears(contract);
    }

	 /**
     * 更新数据
     */
	public void updataContract(Contract contract) {
		contractListDao.updataContract(contract);
	}

	/*
	 * 查看媒体名称
	 * 
	 */
	public List<String> seclectMediaName(String contractId) {
		
		return contractListDao.seclectMediaName(contractId);
	}
    /*
     * 查询合同判断合同编号是否已经存在
     */
	public List<Contract> isEixstContractID(String contractId,String contractName) {
		
		return contractListDao.isEixstContractID(contractId,contractName);
	}

	/**
	 * 通过合同的id查询媒体价格表
	 */
	public List<MediaPrice> seclectMediaPrice(String contractId) {
		return contractListDao.seclectMediaPrice(contractId);
	}
	


}
